package com.xxx.mall.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xxx.mall.dto.SpuPageQuery;
import com.xxx.mall.model.Spu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xxx.mall.vo.SpuVO;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * spu信息 Mapper 接口
 * </p>
 *
 * @author 邢晨旭
 * @since 2023-11-24
 */
public interface SpuMapper extends BaseMapper<Spu> {

    /**
     * 根据spuId查询spu信息
     * @param id
     * @return
     */
    SpuVO queryBySpuId(@Param("spuId") Long id);

    void removeById(Long id);

    Page<SpuVO> pageList(Page<SpuVO> page, @Param("param") SpuPageQuery spuPageQuery);

    /**
     * spu上下架
     * @param id
     * @param status
     */
    void changeStatus(@Param("id") Long id, @Param("status") Integer status);
}
